package edu.pku.hawk.controller.util;

public class SendSample {

	public static void main(String[] args) {
		SendSample ss = new SendSample();
		ss.send();
	}

	private MQManager mgr;

	public SendSample() {

		try {
			mgr = MQManager.getInstance();
			mgr.createProducerQueue(Constants.Ctrl_UI_Proc_QueueName);
		} catch (Exception ex) {
			ex.printStackTrace();
		}

	}

	public void send() {

		ProcDes procDes = new ProcDes();
		procDes.isConbine = true;
		procDes.detectorTypes = new int[] { Constants.TYPE_INFRARED_SENSOR, Constants.TYPE_METAL_SENSOR,
				Constants.TYPE_PRESSURE_SENSOR };

		try {
			MProducerQueue queue = mgr.getProducerQueue(Constants.Ctrl_UI_Proc_QueueName);
			queue.send(procDes);
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

}
